FROM golang:1.16 as builder
ENV GOSUMDB=off
ENV GOPROXY=https://goproxy.cn,direct
WORKDIR /app
ADD . /app
RUN cd /app && go build -ldflags "-X main.GitCommit=`git rev-parse HEAD` -X main.CI=ci" -o main


FROM centos:7
COPY --from=builder /app/main /main
RUN chmod +x /main

EXPOSE 8000
ENTRYPOINT ["./main"]